// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Item {
    width: back.width/2
    height: back.height
    clip: true
    id: root

    signal increment(int size)

    property int value: 5

    Item{
        id:up
        clip: true;
        width:back.width/2
        height: back.height/2
        Image{
            id:back
            source: "images/money/coin_"+root.value+".png"
        }
        MouseArea{
            width: parent.width
            height: parent.height
            hoverEnabled: true
            acceptedButtons: Qt.LeftButton
            onEntered: {
                back.x = -back.width/2;
            }
            onExited: {
                back.x = 0
            }
            onClicked: {
                increment(value);
            }
        }
    }

    Item{
        id:down
        clip: true;
        width:back.width/2
        height: back.height/2
        y: back.height/2
        Image{
            id:back_bottom
            source: "images/money/coin_"+root.value+".png"
            y: -back_bottom.height/2
        }
        MouseArea{
            width: parent.width
            height: parent.height
            hoverEnabled: true
            acceptedButtons: Qt.LeftButton
            onEntered: {
                back_bottom.x = -back_bottom.width/2;
            }
            onExited: {
                back_bottom.x = 0
            }
            onClicked: {
                increment(-value);
            }
        }
    }


    Component.onCompleted:function(){setValue(value)}


}
